package cn.tedu.mybatis.mapper;

import cn.tedu.mybatis.model.Result;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ResultMapper {
    @Insert("insert into result values(#{id},#{studentno},#{subjectid},#{score},#{examdate})")
    int addResult(Result result);

    @Delete("delete from result where id = #{id}")
    int deleteById(int id);

    @Select("select * from result where id = #{id}")
    Result getById(int id);


    @Select("select * from result")
    List<Result> getAll();
}
